# Maintainer: Saijin-Naib <Saijin-Naib_package-maintenance@outlook.com>
pkgname=xed
pkgver=3.4.4
pkgrel=0
pkgdesc="X-Apps Text Editor"
url="https://github.com/linuxmint/xed"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	intltool
	itstool
	libpeas-dev
	gobject-introspection-dev
	gspell-dev
	gtksourceview4-dev
	gvfs-dev
	gzip
	meson
	python3
	xapp-dev
	"
checkdepends="cage-run"
subpackages="$pkgname-lang $pkgname-dev $pkgname-doc $pkgname-python"
source="$pkgname-$pkgver.tar.gz::https://github.com/linuxmint/xed/archive/refs/tags/$pkgver.tar.gz"
options="!check" # needs dogtail

build() {
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	cage-run meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

python() {
	depends="$pkgname=$pkgver-r$pkgrel libpeas-python3"
	pkgdesc="$pkgdesc (python plugins)"
	amove \
		usr/lib/xed/plugins/joinlines* \
		usr/lib/xed/plugins/open-uri-context-menu* \
		usr/lib/xed/plugins/textsize*
}

sha512sums="
5448d392531ede2df1519230615796dbbd3e4caf62472313c922feb364662b6c2c1b5d6b2884e756bd90eaed5caef03e4bd7257615d19fbeaa87bce2afa45948  xed-3.4.4.tar.gz
"
